#include <iostream>
#include <string>
#include "thi_sinh.h"

using namespace std;

thi_sinh::thi_sinh(){
	ma_thi_sinh = "";
	ho_ten = "";
	gioi_tinh = true;
	nam_sinh = 0;
	que_quan = "";
	diem_toan = 0;
	diem_ly = 0;
	diem_hoa = 0;
	tong_diem = 0;
	diem_tieng_anh = 0;
	next = NULL;
}

thi_sinh::thi_sinh ( const string &ma = "", const string &ten = "", const int &gt = 0,
                     const int &ns = 0, const string &que = "", const double &toan = 0,
                     const double &ly = 0, const double &hoa = 0){
                        ma_thi_sinh = ma;
                        ho_ten = ten;
                        if ( gt == 1) gioi_tinh = true;
                        else gioi_tinh = false;
                        nam_sinh = ns;
                        que_quan = que;
                        if ( toan > 10 || toan < 0) diem_toan = 0;
						else diem_toan = toan;
						if ( ly > 10 || ly < 0) diem_ly = 0;
                        else diem_ly = ly;
						if ( hoa > 10 || hoa < 0) diem_hoa = 0;
                        else diem_hoa = hoa;
                        tong_diem = diem_toan + diem_ly + diem_hoa;
                        diem_tieng_anh = 0;
                        next = NULL;
                     }
                     
string thi_sinh::get_ma_thi_sinh () const{
    return ma_thi_sinh;
}                     

string thi_sinh::get_ho_ten () const{
    return ho_ten;
}

bool thi_sinh::get_gioi_tinh() const{
    return gioi_tinh;
}

int thi_sinh::get_nam_sinh() const{
    return nam_sinh;
}

string thi_sinh::get_que_quan()const {
    return que_quan;
}

double thi_sinh::get_diem_toan() const {
    return diem_toan;
}

void thi_sinh::set_diem_toan( const double &diem){
    diem_toan = diem;
}
double thi_sinh::get_diem_ly() const {
    return diem_ly;
}

void thi_sinh::set_diem_ly ( const double &diem ){
	diem_ly = diem;
}

void thi_sinh::set_diem_hoa( const double &diem ){
    diem_hoa = diem;
}

double thi_sinh::get_diem_hoa() const {
    return diem_hoa;
}

double thi_sinh::get_diem_tieng_anh () const {
    return diem_tieng_anh;
}

void thi_sinh::set_diem_tieng_anh (const double &ta) {
    diem_tieng_anh = ta;
}

double thi_sinh::get_tong_diem() const {
    return tong_diem;
}

void thi_sinh::set_tong_diem( const double &diem ){
    tong_diem = diem;
}

void thi_sinh::print(){
    cout << ma_thi_sinh << " | " << ho_ten << " | ";
    if ( gioi_tinh == true ) cout << "1 | ";
    else cout << "0 | ";
    cout << nam_sinh << " | " << que_quan << " | "
    << diem_toan << " | " << diem_ly << " | " << diem_hoa;
    if ( diem_tieng_anh != 0 ) cout <<  " | " << diem_tieng_anh;
}

void thi_sinh::set_next( thi_sinh* a ){
    next = a;
}

thi_sinh* thi_sinh::get_next() const {
    return next;
}